package com.csu.device.service;

import com.alibaba.fastjson.JSONArray;
import com.csu.device.entity.Behavior;
import com.csu.device.entity.DeviceBinding;
import com.csu.device.entity.DeviceRela;
import com.csu.util.PageUtils;

import java.util.List;
import java.util.Map;

public interface DeviveBindingService {

     public PageUtils findDeviceBinding(Map<String,Object> map);

     public Integer findDeviceBindingCount(Map<String,Object> map);

     public Integer addDevive(DeviceBinding deviceBinding);

     public Integer updateDevive(DeviceBinding deviceBinding);

     public Integer deleteDevice(DeviceBinding deviceBinding);

     public List<Map<String,Object>> findAllBehaviorToView(Map<String,Object> map);

     public List<Behavior> findAllBehaviorByError(Map<String,Object> map);


     public Integer bandCard(String userId, String deviceSn,String userName);

     public Integer unBandCard(String deviceSn);


     public List<Map<String,Object>> findAllBehaviorByScene(Map<String,Object> map);


     /**
      * 查询所有异常信息
      * @param map
      * @return
      */
     public PageUtils findAllBehaviorByPage(Map<String,Object> map);

     /**
      * 处理消息
      * @param map
      * @return
      */
     public int updateBehaviorByMessage(Map<String,Object> map);


     /**
      * 查询老人绑定的设备号
      * @param map
      * @return
      */
     public List<Map<String,Object>> findDeviceSnByUserIdOrTypeId(Map<String,Object> map);

     /**
      * 查询所有签约老人
      * @return
      */
     public List<String>  allUserId();

     /**
      * 根据json获取设备使用时长
      */
     public JSONArray findAllDevice(Map<String,Object> map);


     /**
      * 保存电子围栏
      * @param deviceRela
      * @return
      */
     public Integer addDeviceRela(DeviceRela deviceRela);


     /**
      * 删除电子围栏
      * @param deviceRela
      * @return
      */
     public Integer deleteByDeviceRela(DeviceRela deviceRela);


     public JSONArray findBtype();
}
